package api

import (
	"github.com/gin-gonic/gin"
	"zg3yk/api/handler"
	"zg3yk/pkg"
)

func Load(r *gin.Engine) {

	r.POST("/sendSms", handler.SendSms)
	r.POST("/user/login", handler.Login)
	r.POST("/upload", handler.Upload)
	r.GET("/article/list", handler.ListArticle)
	r.GET("/list", handler.List)
	r.Use(pkg.JWTAuth("2209a"))

	r.GET("/user/chat", handler.Chat)
	r.POST("/user/fouc", handler.AddFouc)
	art := r.Group("/article").Use(pkg.JWTAuth("2209a"))
	{
		art.POST("/addArticle", handler.AddArticle)
		art.GET("/get", handler.GetArticle)
		art.POST("/addArticleLike", handler.AddArticleLike)
		art.POST("/addContext", handler.AddContext)
		art.POST("/addContextLike", handler.AddContextLike)
		art.POST("/addContexts", handler.AddContexts)
	}
	r.POST("/qun/addQun", handler.AddQun)
	r.POST("/qun/addQunUser", handler.AddQunUser)
	r.POST("/qun/qunUser", handler.QunUser)
	r.POST("/qun/DeleteQun", handler.DeleteQun)

}
